class Solution(object):
    def canJump(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        if len(nums)<=1:
            return True
        minLength = 1
        for i in range(len(nums)-2, 0, -1):
            if nums[i]<minLength:
                minLength+=1
            else:
                minLength = 1
        return nums[0]>=minLength

print(Solution().canJump([0]))